/*
 * CNeuralNet.h
 *
 *  Created on: 26 Dec 2013
 *      Author: benjamin
 */

#ifndef CNEURALNET_H_
#define CNEURALNET_H_
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <cstring>
#include <stdio.h>
#include <stdint.h>

typedef unsigned int uint;
#define EPSILON 0.00001d
class CNeuralNet {
private:
	double ** _weights_h_i;
	double ** _weights_o_h;
	uint _inputLayerSize;
	uint _hiddenLayerSize;
	uint _outputLayerSize;
	double _lRate;

	double * _inputs;
	double * _hidden;
	double * _outputs;

	void feedForward(const double * const inputs);
	void propagateErrorBackward(const double * const desiredOutput);
	double meanSquaredError(const double * const desiredOutput);
	void initWeights();
public:
	CNeuralNet(uint inputLayerSize, uint hiddenLayerSize, uint outputLayerSize, double lRate);
	void train(const double ** const inputs,const double ** const outputs, uint trainingSetSize);
	uint classify(const double * const input);
	virtual ~CNeuralNet();
};

#endif /* CNEURALNET_H_ */
